home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / misc / Shield.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  2.8 KB  |  101 lines

  1. class classes.misc.Shield
  2. {
  3.    var clip;
  4.    var shape;
  5.    var facing;
  6.    var oldFacing;
  7.    var out = false;
  8.    var Name = "shield";
  9.    function Shield()
  10.    {
  11.       this.clip = _root.attachMovie("shield","shieldClip",300070);
  12.       var _loc3_ = "";
  13.       if(_root.char == "broShip1")
  14.       {
  15.          var _loc4_ = _root.bro1ShipLevel <= 3 ? "_" + _root.bro1ShipLevel : "_" + (_root.bro1ShipLevel - 3);
  16.          if(_root.bro1ShipVar != 1)
  17.          {
  18.             _loc3_ = _root.bro1ShipVar != 7 ? "B" : "Black";
  19.          }
  20.       }
  21.       else if(_root.char == "broShip2")
  22.       {
  23.          _loc4_ = _root.bro2ShipLevel <= 3 ? "_" + _root.bro2ShipLevel : "_" + (_root.bro2ShipLevel - 3);
  24.          if(_root.bro2ShipVar != 1)
  25.          {
  26.             _loc3_ = _root.bro2ShipVar != 7 ? "B" : "Black";
  27.          }
  28.       }
  29.       else
  30.       {
  31.          _loc4_ = "";
  32.       }
  33.       this.shape = _root.char + _loc4_ + _loc3_;
  34.       if(_loc3_ == "Black")
  35.       {
  36.          this.shape = "shipBlack";
  37.       }
  38.       this.clip.masks.gotoAndStop(this.shape + _root[_root.char].facing);
  39.       this.clip._x = _root[_root.char].x;
  40.       this.clip._y = _root[_root.char].y;
  41.    }
  42.    function hit()
  43.    {
  44.       this.out = true;
  45.       this.clip.shieldClip.gotoAndPlay("hit");
  46.       _root.audio.playLevel3("shieldHit",28);
  47.    }
  48.    function renew()
  49.    {
  50.       this.clip.shieldClip.gotoAndPlay(1);
  51.       _root.audio.playLevel3("shield2",_root.randRange(29,35));
  52.    }
  53.    function yank()
  54.    {
  55.       _root[_root.char].shieldOn = false;
  56.       _root.removePowerUp("shield");
  57.    }
  58.    function tagTeam()
  59.    {
  60.       var _loc3_ = "";
  61.       if(_root.char == "broShip1")
  62.       {
  63.          var _loc4_ = _root.bro1ShipLevel <= 3 ? "_" + _root.bro1ShipLevel : "_" + (_root.bro1ShipLevel - 3);
  64.          if(_root.bro1ShipVar != 1)
  65.          {
  66.             _loc3_ = _root.bro1ShipVar != 7 ? "B" : "Black";
  67.          }
  68.       }
  69.       else if(_root.char == "broShip2")
  70.       {
  71.          _loc4_ = _root.bro2ShipLevel <= 3 ? "_" + _root.bro2ShipLevel : "_" + (_root.bro2ShipLevel - 3);
  72.          if(_root.bro2ShipVar != 1)
  73.          {
  74.             _loc3_ = _root.bro2ShipVar != 7 ? "B" : "Black";
  75.          }
  76.       }
  77.       else
  78.       {
  79.          _loc4_ = "";
  80.       }
  81.       this.shape = _root.char + _loc4_ + _loc3_;
  82.       if(_loc3_ == "Black")
  83.       {
  84.          this.shape = "shipBlack";
  85.       }
  86.       this.clip.masks.gotoAndStop(this.shape + _root[_root.char].facing);
  87.       _root[_root.char].shieldOn = true;
  88.    }
  89.    function main()
  90.    {
  91.       this.facing = _root[_root.char].facing;
  92.       if(this.facing != this.oldFacing)
  93.       {
  94.          this.clip.masks.gotoAndStop(this.shape + this.facing);
  95.       }
  96.       this.oldFacing = this.facing;
  97.       this.clip._x = _root[_root.char].x;
  98.       this.clip._y = _root[_root.char].y;
  99.    }
  100. }
  101.